package com.hp.springioc02;

import com.hp.springioc01.Computer;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpringIOCXML {

    public static void main(String[] args) {
        //创建Claspath应用程序员上下文
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("springioc01.xml");
        //获得对象，实现IOC
//        Computer computer = (Computer) context.getBean("computer");
        Computer computer = context.getBean(Computer.class);
        computer.start();
//        Computer computer1 = context.getBean(Computer.class);
//        computer1.start();
//        System.out.println(computer == computer1);
    }
}
